import {
  createRouter,
  // 创建 history 路由
  createWebHistory,
  //  创建 hash 路由
  createWebHashHistory,
} from 'vue-router'

import HomePage from './components/HomePage.vue'
import ListPage from './components/ListPage.vue'
import DetailPage from './components/DetailPage.vue'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/home',
      component: HomePage
    },
    {
      path: '/list',
      component: ListPage
    },
    // 动态路由
    {
      path: '/detail/:id',
      component: DetailPage
    }
  ]
})

export default router